package Email.auto.checker;

import java.awt.Component;

import javax.swing.JOptionPane;

/**
 * 
 * @author Emanuel Bicho
 * @author Marcio Almeida
 *
 */
public class ErrorNotification {

	public static void showErrorMessage(Component cp, int errorCode) {

		switch (errorCode) {
		case ConstErrorNotification.LOGIN_ERROR:
			JOptionPane
					.showMessageDialog(
							cp,
							"Error, impossible to login to the server, please try again later...",
							"Login error", JOptionPane.ERROR_MESSAGE, null);

			break;

		case ConstErrorNotification.VERIFY_EMAIL_ERROR:
			JOptionPane
					.showMessageDialog(
							cp,
							"Error while communicating with the server, please try again later...",
							"Verify email error", JOptionPane.ERROR_MESSAGE,
							null);
			break;
		case ConstErrorNotification.MINIMUM_TIMEOUT_VALUE_ERROR:
			JOptionPane.showMessageDialog(cp, "The minimum time is 3 minutes",
					"Timeout error", JOptionPane.ERROR_MESSAGE, null);
			break;
		case ConstErrorNotification.NOT_INTEGER_TIMEOUT_VALUE_ERROR:
			JOptionPane.showMessageDialog(cp,
					"Please insert a integer number bigger than 3.",
					"Value error", JOptionPane.ERROR_MESSAGE, null);
			break;
		}

	}

}
